<template>
  <div id="yanxuanzhuanlan">
    <div class="box">
      <span class="q1" @click="pao">&lt;</span><span class="q2">严选专栏</span>
    </div>
    <div class="box5">
      <ul>
        <li v-for="item in list" :key="item.id" @click="tiao(item.id)">
          <img :src="item.pic" alt="" />
          <p v-html="item.title"></p>
          <p class="qq">{{item.descript}}</p>
          <button>查看详情</button>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { getjingxuan } from "../utils/api";
export default {
  name: "",
  data() {
    return {
      list: [],
    };
  },
  created() {
    getjingxuan().then((res) => {
     
      this.list = res;
    });
  },
  methods: {
    pao() {
      this.$router.go(-1);
    },
    tiao(id){

        this.$router.push({
            path:'/zhuanlanxiangqing',
            query:{
                id
            }
        })
       
    }
  },
};
</script>

<style scoped lang='scss'>
.box {
  width: 100%;
  height: 50px;
  line-height: 50px;
  border-bottom: 1px solid #cccc;
  .q1 {
    font-size: 20px;
    margin-left: 24px;
  }
  .q2 {
    margin-left: 110px;
    font-size: 18px;
  }
}
.box5 {
  width: 100%;
  ul {
    width: 100%;
    list-style: none;
    li {
      position: relative;
      width: 100%;
      height: 200px;
      background-color: red;
      margin-top: 10px;
       .qq {
        display: inline-block;
        width: 80%;
        white-space: nowrap;
        overflow: hidden;

        text-overflow: ellipsis;

        position: absolute;
        top: 90px;
        left: 30px;
        color: white;
        //  z-index: 999;
      }
      img {
        width: 100%;
        height: 200px;
      }
      p {
           width: 80%;
        white-space: nowrap;
        overflow: hidden;

        text-overflow: ellipsis;
        position: absolute;
        top: 50px;
        left: 60px;
        color: white;
        z-index: 999;
      }
     button{
     position: absolute;
        height: 30px;
        width: 80px;
        top: 130px;
        left: 150px;
        color: white;
        z-index: 999;
        border: none;
        border: 1px solid white;
        border-radius: 30px;
        font-size: 12px;
        background-color: rgba(0, 0, 0, 0.137);
     }
    }
  }
}
</style>